/*
* Copyright 2024 NXP
* NXP Confidential and Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"


void setup_scr_screen_background(lv_ui *ui)
{
	//Write codes screen_background
	ui->screen_background = lv_obj_create(NULL);
	lv_obj_set_size(ui->screen_background, 480, 320);
	lv_obj_set_scrollbar_mode(ui->screen_background, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_background, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_background, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_background_img_background_2
	ui->screen_background_img_background_2 = lv_img_create(ui->screen_background);
	lv_obj_add_flag(ui->screen_background_img_background_2, LV_OBJ_FLAG_CLICKABLE);
	lv_img_set_src(ui->screen_background_img_background_2, &_4_5_480x320);
	lv_img_set_pivot(ui->screen_background_img_background_2, 50,50);
	lv_img_set_angle(ui->screen_background_img_background_2, 0);
	lv_obj_set_pos(ui->screen_background_img_background_2, 0, 0);
	lv_obj_set_size(ui->screen_background_img_background_2, 480, 320);
	lv_obj_set_scrollbar_mode(ui->screen_background_img_background_2, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_background_img_background_2, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_img_opa(ui->screen_background_img_background_2, 255, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_background_img_background_1
	ui->screen_background_img_background_1 = lv_img_create(ui->screen_background);
	lv_obj_add_flag(ui->screen_background_img_background_1, LV_OBJ_FLAG_CLICKABLE);
	lv_img_set_src(ui->screen_background_img_background_1, &_3_3_480x320);
	lv_img_set_pivot(ui->screen_background_img_background_1, 50,50);
	lv_img_set_angle(ui->screen_background_img_background_1, 0);
	lv_obj_set_pos(ui->screen_background_img_background_1, 0, 0);
	lv_obj_set_size(ui->screen_background_img_background_1, 480, 320);
	lv_obj_set_scrollbar_mode(ui->screen_background_img_background_1, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_background_img_background_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_img_opa(ui->screen_background_img_background_1, 255, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_background_btn_imageswitch
	ui->screen_background_btn_imageswitch = lv_btn_create(ui->screen_background);
	ui->screen_background_btn_imageswitch_label = lv_label_create(ui->screen_background_btn_imageswitch);
	lv_label_set_text(ui->screen_background_btn_imageswitch_label, "");
	lv_label_set_long_mode(ui->screen_background_btn_imageswitch_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->screen_background_btn_imageswitch_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->screen_background_btn_imageswitch, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->screen_background_btn_imageswitch, 199, 124);
	lv_obj_set_size(ui->screen_background_btn_imageswitch, 78, 73);
	lv_obj_set_scrollbar_mode(ui->screen_background_btn_imageswitch, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_background_btn_imageswitch, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_background_btn_imageswitch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->screen_background_btn_imageswitch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_background_btn_imageswitch, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_background_btn_imageswitch, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_background_btn_imageswitch, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_background_btn_imageswitch, &lv_font_simsun_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_background_btn_imageswitch, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Write codes screen_background_btn_return
	ui->screen_background_btn_return = lv_btn_create(ui->screen_background);
	ui->screen_background_btn_return_label = lv_label_create(ui->screen_background_btn_return);
	lv_label_set_text(ui->screen_background_btn_return_label, "");
	lv_label_set_long_mode(ui->screen_background_btn_return_label, LV_LABEL_LONG_WRAP);
	lv_obj_align(ui->screen_background_btn_return_label, LV_ALIGN_CENTER, 0, 0);
	lv_obj_set_style_pad_all(ui->screen_background_btn_return, 0, LV_STATE_DEFAULT);
	lv_obj_set_pos(ui->screen_background_btn_return, 0, 0);
	lv_obj_set_size(ui->screen_background_btn_return, 64, 60);
	lv_obj_set_scrollbar_mode(ui->screen_background_btn_return, LV_SCROLLBAR_MODE_OFF);

	//Write style for screen_background_btn_return, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
	lv_obj_set_style_bg_opa(ui->screen_background_btn_return, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_border_width(ui->screen_background_btn_return, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_radius(ui->screen_background_btn_return, 5, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_shadow_width(ui->screen_background_btn_return, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_color(ui->screen_background_btn_return, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_font(ui->screen_background_btn_return, &lv_font_montserratMedium_16, LV_PART_MAIN|LV_STATE_DEFAULT);
	lv_obj_set_style_text_align(ui->screen_background_btn_return, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);

	//Update current screen layout.
	lv_obj_update_layout(ui->screen_background);

	
	//Init events for screen.
	events_init_screen_background(ui);
}
